Pipette = Widget.extend({
	ctor:function(){
		this._super();
		this.init();
		this.setTag(TAG_PIPETTE_ALL);
		this.suction();
	},
	init:function(){
		//移液管
		this.body = new Button(this, 10, TAG_PIPETTE, "#pipette.png", this.callback,this);
		
		var film=new Button(this.body,10,TAG_PIPETTE_FILM,"#film.png",this.callback,this);
		film.setPosition(cc.p(this.body.width*0.5, this.body.height*0.1));
		film.setScale(0.15);
		film.setOpacity(0);
		
		var show1=new Button(this.body,10,TAG_PIPETTE_SHOW,"#show1.png",this.callback,this);
		show1.setPosition(cc.p(-this.body.width*2.5, this.body.height*0.8));
		show1.setOpacity(0);
		
		var show2=new Button(this.body,10,TAG_PIPETTE_SHOW1,"#show2.png",this.callback,this);
		show2.setPosition(cc.p(-this.body.width*2.5, this.body.height*0.5));
		show2.setOpacity(0);
		
		var flow=new Button(this.body,10,TAG_PIPETTE_FLOW,"#flow1.png",this.callback,this);
		flow.setAnchorPoint(cc.p(0.5, 1));
		flow.setPosition(cc.p(this.body.width*0.45,this.body.height*0.04));
		flow.setOpacity(0);
	},
	show:function(){
		var show1=this.body.getChildByTag(TAG_PIPETTE_SHOW);
		var fadein=cc.fadeIn(0.1);
		var fadeout=cc.fadeOut(0.1);
		show1.runAction(cc.sequence(fadein,cc.delayTime(1),fadeout));
	},
	show1:function(){
		var show2=this.body.getChildByTag(TAG_PIPETTE_SHOW1);
		var fadein=cc.fadeIn(0.1);
		var fadeout=cc.fadeOut(0.1);
		show2.runAction(cc.sequence(fadein,cc.delayTime(1),fadeout));
	},
	show2:function(){
		var flow=this.body.getChildByTag(TAG_PIPETTE_FLOW);
		var fadein=cc.fadeIn(0.1);
		var fadeout=cc.fadeOut(0.1);
		flow.runAction(cc.sequence(fadein,cc.delayTime(3.5),fadeout));
	},
	move:function(){
		var ber=cc.bezierBy(1, [cc.p(10, 150),cc.p(80,160),cc.p(132,75)]);
		this.body.runAction(ber);
	},
	suction:function(){
		var func=cc.callFunc(function() {
			gg.flow.next();
		},this);
		var film=this.body.getChildByTag(TAG_PIPETTE_FILM);
		var beaker=ll.run.getChildByTag(TAG_BEAKER_ALL);
		var fadein=cc.fadeIn(0.1);
		var move=cc.moveBy(0.5,cc.p(0, this.body.height*0.25));
		var move1=cc.moveBy(0.5,cc.p(0, this.body.height*0.08));
		var move2=cc.moveBy(1.5,cc.p(0, this.body.height*0.185));
		var move3=cc.moveBy(0.5,cc.p(0, this.body.height*0.1));
		var move4=cc.moveBy(0.5,cc.p(0, -this.body.height*0.08));
		var scale=cc.scaleBy(0.5,2.3);
		
		var flask=ll.run.getChildByTag(TAG_FLASK_ALL);
		film.runAction(cc.sequence(cc.delayTime(1),fadein,
				cc.spawn(cc.sequence(move,cc.spawn(move1,scale),move2,cc.spawn(move1,scale.reverse()),move3),cc.callFunc(function() {
					beaker.downLine();
				}, this)),cc.callFunc(function() {
			this.show();
			},this),cc.delayTime(1.5),cc.callFunc(function() {
			this.move();
			},this),cc.delayTime(1),cc.spawn(cc.sequence(move3.reverse(),cc.spawn(move1.reverse(),scale),move2.reverse(),
					cc.spawn(move1.reverse(),scale.reverse()),move.reverse()),cc.callFunc(function() {
				flask.show();
				this.show2();
			},this)),cc.delayTime(1.5),cc.callFunc(function() {
			this.body.setVisible(false);
			beaker.setVisible(false);
		},this),func));
	}
});